<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<h:head>
		<title>Election</title>	
	</h:head>
	<f:metadata>
        <f:viewParam name="partyname" value="#{elePartyViewBean.partyname}" />
        <f:event type="preRenderView" listener="#{elePartyViewBean.init}" />
   	</f:metadata>
    
 	<f:metadata>
    	<f:viewParam name="memberid" value="#{o.member.ID}"/>
	</f:metadata>
	<h:body>
	<ui:include src="/horizontal_menu.xhtml">
	</ui:include>
		<h:form>
				 <p:dataTable var="o" value="#{elePartyViewBean.eleVotes}"  paginator="true" rows="10">
				<!-- selection="#{tableBean.selectedCar}" <p:ajax event="rowSelect" update=":form:display" oncomplete="carDialog.show()" />-->

                <f:facet name="header">
                    #{('Memberlist of: ').concat(elePartyViewBean.party.name)}
                </f:facet>

                  <p:column headerText="Priority" id="Priority">
                    <h:selectOneMenu id="selection" value="#{o.priority}"> 
						<f:selectItem itemValue="#{elePartyViewBean.zero}" /> 
						<f:selectItem itemValue="#{elePartyViewBean.one}" /> 
						<f:selectItem itemValue="#{elePartyViewBean.two}" /> 
						<f:selectItem itemValue="#{elePartyViewBean.three}" /> 
					</h:selectOneMenu>
               </p:column>
                 
                <p:column headerText="Name" id="name">
                    #{o.member.citizen.name}
                </p:column>

                <p:column headerText="Surname" id="surname">
                    #{o.member.citizen.surname}
                </p:column>
                
				<p:column headerText="Member Page's" id="page">
                    <h:link outcome="/memberpage" value="member page's">
                    	<f:param  name="memberid" value="#{o.member.ID}" /> 
                    </h:link>
                </p:column>
            </p:dataTable>
            <center><h:commandButton value="Submit Vote" action="#{elePartyViewBean.submit()}" />
			        <h:commandButton value="Reset" type="reset" /><br/>
			        <h:button value="Vote Later" outcome="/citizen/personalpage" /></center>
     		</h:form>
	</h:body>
</html>